package com.stan.core.spark.ad.blackList.functions;

import com.google.common.base.Optional;
import org.apache.spark.api.java.function.PairFunction;
import scala.Tuple2;

import java.io.Serializable;

public class UserId2DataAndBlackToUserId2DataFunction
    implements PairFunction<Tuple2<String, Tuple2<String, Optional<Boolean>>>, String, String>, Serializable {
    @Override
    public Tuple2<String, String> call(Tuple2<String, Tuple2<String, Optional<Boolean>>>
                                               stringTuple2Tuple2) throws Exception {
        String userId = stringTuple2Tuple2._1;
        String data = stringTuple2Tuple2._2._1;
        return new Tuple2<String, String>(userId,data);
    }
}
